import JSEncrypt from "jsencrypt";

// 使用RSA密码加密方式
export const encrypt = (text: any) => {
    const encrypt = new JSEncrypt();
    encrypt.setPublicKey(
      `MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAt4VKlnBJ8ZqtL/975xzG
      0WrUlHjcJJwWifVscuJH6Gv652uVqb8B0c5cvB/sMGPhb6BObdFsiPwfwO3ahDem
      3pglH4Ugp/+auy8Hia8bXum4qXlVWvyXuXTZBXtqV8d5/scw4qXRXn5/PGX5nKHK
      3sDhs3rkE0FWE30C5jZ3EW+b58RRau5gogHyjSXEQybLkohCP0YkMj5wM4QZgSgU
      s1ch219wfl2X3BdMkU9whH4W28by3xJrUAcPcpHOBTF7TRGCmTmzLD9wz8QFnlU7
      7GYvduCA3Hp5bxzdsbmKeCWu5MFQQQ6cTRNRzGjKv5+FzLmv3efQRcO0yXIKRd6K
      kwIDAQAB`,
    );
    const encrypted = encrypt.encrypt(text);
    return encrypted;
  };